/*
* @Author: root
* @Date:   2017-11-29 21:14:27
* @Last Modified by:   root
* @Last Modified time: 2017-12-07 23:16:04
*/
'use strict';

var _utils = require('util/util.js');

var _cart = {
   
    // 获取订单信息
    getProductList : function(resolve, reject){
        _utils.request({
            url     : _utils.getServerUrl('/order/get_order_cart_product.do'),
            success : resolve,
            error   : reject
        });
    },
    // 提交订单
    createOrder : function(OrderInfo, resolve, reject){
        _utils.request({
            url     : _utils.getServerUrl('/order/create.do'),
            data    : OrderInfo,
            success : resolve,
            error   : reject
        });
    },
    //获取订单列表
    getOrderList : function(listParam,resolve, reject){
        _utils.request({
            url     : _utils.getServerUrl('/order/list.do'),
            data    : listParam,
            success : resolve,
            error   : reject
        });
    },
    //获取订单详情
    getOrderDetail : function(orderNumber,resolve, reject){
         _utils.request({
            url     : _utils.getServerUrl('/order/detail.do'),
            data    : {
                orderNo : orderNumber
            },
            success : resolve,
            error   : reject
        });
    },
    //取消订单
    cancelOrder : function(orderNumber,resolve, reject){
         _utils.request({
            url     : _utils.getServerUrl('/order/cancel.do'),
            data    : {
                orderNo : orderNumber
            },
            success : resolve,
            error   : reject
        });
    }     
}
module.exports = _cart;